/**
 * outsider.com.cn Inc.
 * Copyright (c) 2011-2022 All Rights Reserved.
 */
package com.yuanmeng.common.core.enums;

import com.yuanmeng.common.core.exception.ServiceException;

import lombok.Getter;

/**
 * @author outsider
 * @version Id: StatusEnum.java, v 0.1 2022/6/1 17:16 outsider Exp $$
 */
@Getter
public enum CommentTypeEnum {
    VIDEO("VIDEO", "短视频"),

    MALL_ORDER("MALL_ORDER", "商城订单"),

    COMMUNITY_ORDER("COMMUNITY_ORDER", "社区订单");

    private String code;

    private String message;

    CommentTypeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static void validateCommentType(String commentType) {
        int num = 0;
        for(CommentTypeEnum ENUM : CommentTypeEnum.values()) {
            if(ENUM.code.equals(commentType)) {
                num ++;
            }
        }
        if(num == 0) {
            throw new ServiceException("请求参数非法：commentType");
        }
    }
}